 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!doctype html>
<html>
	<head>
		<meta name="renderer" content="webkit|ie-comp|ie-stand">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta charset='utf-8'>
        <meta name="author" content="order by dede58.com"/>
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<title>我的订单</title>
		<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta http-equiv="Cache-Control" content="no-siteapp">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<meta name="keywords" content="">
		<meta name="description" content="">
		<link rel="stylesheet" type="text/css" href="front/css/base.css" />
		<link rel="stylesheet" type="text/css" href="front/css/common.css" />
		
		
		
		<script src="front/js/jquery-1.8.3.min.js" type="text/javascript"></script>
		<script type="text/javascript" src="front/js/jquery.SuperSlide.2.1.js"></script>
		
		
	</head>
	<style>
	.bc{
		background:#fff;
		border:1px solid red;
		color:red;
		}
	</style>
	
	<script type="text/javascript">
		$(function(){
			let c = "<!--header star-->"+
			"<div class=\"header clearfix\">"+
				"<div class=\"top clearfix\">"+
					"<div class=\"topctent clearfix\">"+
						"<div class=\"left clearfix fl\">"+
							"公告：您好，欢迎登录游戏商场"+
						"</div>"+
						"<div class=\"right clearfix fr\">"+
							"<div class=\"zuo clearfix fl\">"+
								"<ul class=\"clearfix fl\">"+
									"<li id = \"customerInfo\">"+

									"</li>"+
									"<li>"+
										"<a href=\"register.jsp\">"+
											"免费注册"+
										"</a>"+
									"</li>"+
									"<li>"+
										"<a href=\"settled.html\">"+
											"商家入驻"+
										"</a>"+
									"</li>"+
								"</ul>"+
							"</div>"+				
							"<div class=\"shopcar-btn clearfix fl\">"+
								"<a href=\"javascript:void(0)\" class=\"box-s\" id=\"shopCount\">"+
									"购物车（0）"+
								"</a>"+
							"</div>"+
							"<div class=\"fenxiang clearfix fl\">"+
								"<span class=\"fl\">分享到：</span>"+
								"<ul class=\"clearfix fl\">"+
									"<li><a href=\"#\"><img src=\"img/sina.png\"/></a></li>"+
									"<li><a href=\"#\"><img src=\"img/qq.png\"/></a></li>"+
									"<li><a href=\"#\"><img src=\"img/wechat.png\"/></a></li>"+
								"</ul>"+
							"</div>"+
						"</div>"+				
					"</div>"+
				"</div>"+			
				"<div class=\"bottom clearfix\" style=\"\">"+
					"<div class=\"clearfix\">"+
					"<video loop=\"loop\" autoplay=\"autoplay\" preload=\"\" muted=\"muted\" src=\"https://a.sinaimg.cn/mintra/pic/2112130543/weibo_login.mp4\" poster=\"https://a.sinaimg.cn/mintra/pic/2112130400/18weibo_login.png\" class=\"LoginTopNav_video_1W33g\" style=\"position: absolute; width: 1540px; right: -170px;\"> 抱歉，您的浏览器不支持内嵌视频 </video>"+
						/* "<div class=\"bnetIcon--3gWUG icon--1SZos\" aria-hidden=\"true\" style=\"color: #148eff;width: 130px;\">"+
								"<div class=\"iconSvg--7rod7\" style=\"fill: currentColor;\">"+
									"<svg focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 600 580.4\">"+
										"<path d=\"M473.5 197.6c-75.9-35.1-185.1-57.4-287.8-49.1 5.1-34 17.9-57.7 38.7-62.7 28.7-6.9 60 12 89.8 46.3 19.5 2.5 42.7 7 58.9 10.7C318.7 40.5 245.7-16.8 190.2 4.4 148 20.5 126.4 78.6 129 156.7c-55 11.7-97.9 32.5-125.4 62.4-1.4 1.6-4.5 5.7-3.4 7.6.9 1.5 3.6-.2 4.9-1 31.8-22.3 72.6-34.3 125.7-41.9 7.6 83.3 42.8 189 101.4 273.8-32 12.6-58.9 13.4-73.6-2.2-20.3-21.4-19.6-58-4.8-101-7.6-18.2-15.3-40.5-20.1-56.3-61.6 98.3-74.8 190.2-28.7 227.7 35.1 28.5 96.2 18.2 162.5-23.1 37.6 41.8 77.1 68.5 116.7 77.3 2.1.4 7.2 1.1 8.3-.8.9-1.5-2-3.1-3.3-3.7-35.2-16.4-66-45.7-99.1-87.9 68.4-48.2 142.3-131.6 186.4-224.7 26.9 21.5 41 44.3 34.9 64.9-8.4 28.3-40.4 46-85.1 54.6-12 15.7-27.4 33.5-38.7 45.6 115.8 4 202-30.5 211.4-89.1 7.2-44.6-32.4-92.4-101.3-129.2 17.4-53.5 20.8-101 8.6-139.7-.7-2-2.6-6.8-4.9-6.8-1.7 0-1.7 3.3-1.6 4.7 3.6 38.6-6.3 80-26.3 129.7zM260.2 444.3c-49-78.6-77.2-171.2-77.1-264.8 92.6-3.1 186.9 18.7 267.9 65.7-43.6 81.7-109.6 152.5-190.8 199.1z\">"+
										"</path>"+
									"</svg>"+
								"</div>"+
						"</div>"+
						"<a href=\"index.jsp\" style=\"position: absolute;top: 0px;width: 130px;height: 120px;\">"+
							
						"</a>"+ */
					"</div>"+
					"<!-- <div class=\"search clearfix fr ra5\">"+
						"<input type=\"text\" class=\"fl\" name=\"\" id=\"\" value=\"\" placeholder=\"请输入您要搜索的内容\" />"+
						"<input type=\"button\" name=\"\" id=\"\" value=\"搜索\" class=\"fl box-s\" />"+
					"</div> -->"+
				"</div>"+
			"</div>"+
			"<!--header end-->"+
			
			"<!--navbar star-->"+
			"<div class=\"navbar clearfix\" style=\"position: relative;background-color: rgba(0,0,0,0);\">"+
				"<div class=\"content clearfix\">"+
					"<ul style=\"background-color: rgba(0,191,255,0.5);height: 51px;\">"+<!-- style=\"background-color: rgba(0,191,255,0.5);height: 51px;\" -->
						"<li><a href=\"front/index.jsp\">首页精选</a></li>"+
						"<li><a href=\"error.jsp\">游戏专场(待开放)</a></li>"+
						"<li class=\"cur\"><a href=\"front/mall.jsp\">游戏商城</a></li>"+
						"<li><a href=\"error.jsp\">游戏商家(待开放)</a></li>"+
					"</ul>"+
				"</div>"+
			"</div>"+
			"<!--navbar end-->";
		$("#cen").before(c);
		
		let cid = ${!empty sessionScope.customer.customerId} ?　"${sessionScope.customer.customerId}" : 0;
		/* 获取购物车中游戏数量*/
		
		function s(){
			
			$.ajax({
				async:true,
				type:"GET",
				url:"../OrderServlet",
				data:{
					op:"find",
					orderNo:"0",
					customerId:cid
				},
				contentType:"application/x-www-form-urlencoded",
				dataType:"json",
				success:function(result,status,xhr){
					let count = 0;
					$.each(result.data,function(index,games){
						count = index + 1;
					});
					$("#shopCount").text("购物车（"+count+"）");
					
				},
				
			});	
		}
		/* 调用方法获取购物车中游戏数量*/
		if(cid!=0){
			s();
		}
		
	});
	</script>
		
		
	<script>
	$(function(){
		/* 获取登陆信息 */
		let nickname = "${sessionScope.customer.nickname}";
		let content = "";
		if(nickname!=""){
			content = "<span class=\"fl\">欢迎</span>"+
					"<a href=\"grxx.jsp\" class=\"fl\">"+nickname+"</a>"+
					"<span class=\"fl\">进入商城</span>"+
					"<a href=\"../LoginServlet?op=customerLogout\" class=\"fl\">退出登陆</a>";
		}else{
			content = "<span class=\"fl\">您好，请</span>"+
					"<a href=\"sign.jsp\" class=\"fl\">登录</a>";
		}
		$("#customerInfo").html(content);
		
		$(document).on("click","#shopCount",function(){
			if(nickname!=""){
				$(this).prop("href","shopping.jsp");
			}else{
				alert("请先登录");
			}
		});
		
		
	});
	</script>
	
	<body>
		

		<!--Main-wrap-->
		<div class="main-wrap graybg" id="cen" style="margin-top: 86px;">
			<div class="wrapper pt40 pb40 clearfix">
				<div class="fl slide-nav white-box">
					<ul>
						<li>
							<a href="${pageContext.request.contextPath}/CustomerServlet?op=find" class="db fs16">个人信息</a>
						</li>
						<li class="on">
							<a href="${pageContext.request.contextPath}/CustomerServlet?op=order" class="db fs16">我的订单</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/CustomerServlet?op=pjsd" class="db fs16">我的游戏库</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/CustomerServlet?op=shoucang" class="db fs16">我的收藏</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/CustomerServlet?op=xiugai" class="db fs16">修改密码</a>
						</li>
						<li>
							<a href="zhye.html" class="db fs16">账户余额</a>
						</li>
						<li>
							<a href="zxcz.html" class="db fs16">在线充值</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/CustomerServlet?op=comment" class="db fs16">我的评价</a>
						</li>
					</ul>
				</div>
				<div class="fr slide-show white-box">
					<div class="dark-tit clearfix">
						<h3 class="fl fs26">我的订单</h3>
						<p class="fr slide-t-nav">
							<a id="order" href="${pageContext.request.contextPath}/CustomerServlet?op=order" class="unClicked">已支付</a>
							<a id="unpaid"  class="unClicked" 
							href="${pageContext.request.contextPath}/CustomerServlet?op=unpaid">待支付</a>
							<a id="chaoshi"  class="unClicked" 
							href="${pageContext.request.contextPath}/CustomerServlet?op=chaoshi">已超时</a>
						</p>
					</div>
					<table class="table_1">
						<tr>
							<th width="34%">商品信息</th>
							<th width="18%">单价（元）</th>
							<th width="17%">数量</th>
							<th width="17%">用户名</th>
							<th width="24%" rowspan="2">订单状态</th>
						</tr>
					</table>					
					<table class="table_1 mt15">
					<c:forEach items="${requestScope.orderMsg}" var="orderMsg" >
						<tr>
							<th align="left" colspan="6">
								<p class="fs12"><span class="fr pr10">订单金额：${orderMsg.price}</span>订单号：${orderMsg.order_no}　下单时间：${orderMsg.pay_time}</p>
							</th>
						</tr>
						<tr>
							<td width="30%"align="center">
								<p class="clearfix o-goods-info"align="center">
									<a href="#" class="fl"><span><img src="FileDownloadServlet?type=image&fileName=${orderMsg.image}"></span></a>
									<span class="fl tit "align="center">${orderMsg.gamesName}</span>
								</p>
							</td>
							<td width="16%" align="center">${orderMsg.price}</td>
							<td width="15%" align="center">${orderMsg.number}</td>
							<td width="15%" rowspan="2" align="center">${orderMsg.nickname}</td>
							<td width="12%" rowspan="2" align="center">${orderMsg.status==1?'已支付':'未支付'}<br>
								<a href="#" class="orange">订单详情</a>
							</td>						
						</tr>
					</c:forEach>
		
				</table>
					<div class="tab-pages">
						<a href="#" class="tab-prev tab-btn">上一页</a>
						<a href="#" class="page-btn current">1</a>
						<a href="#" class="page-btn">2</a>
						<a href="#" class="page-btn">3</a>
						<a href="#" class="tab-next tab-btn">下一页</a>
					</div>

				</div>

			</div>
		</div>
		<!--/end-->

		<!--footer star-->
		<div class="footer clearfix">
			<div class="content clearfix">
				<div class="top clearfix">
					<div class="list clearfix fl box-s">
						<div class="part icon1 box-s">
							<h3>专业</h3>
							<p>拥有资深艺术顾问和先进交易平台，安全物流，快捷支付。</p>
						</div>
					</div>
					<div class="list clearfix fl box-s">
						<div class="part icon2 box-s">
							<h3>保真</h3>
							<p>阵容强大的艺术评鉴团，确保平台上的藏品货真价实。</p>
						</div>
					</div>
					<div class="list clearfix fl box-s">
						<div class="part icon3 box-s">
							<h3>保值</h3>
							<p>为您精选具备艺术价值的作品，助您的资产保值、增值。</p>
						</div>
					</div>
				</div>
				<div class="bottom clearfix">
					<div class="left clearfix fl">
						<div class="list clearfix">
							<div class="shang clearfix">
								<p>新手指南</p>
								<span></span>
							</div>							
							<div class="xia clearfix">
								<ul>
									<li><a href="scgmlc.html">商城购买流程</a></li>
									<li><a href="cjwt.html">常见问题</a></li>
								</ul>
							</div>
						</div>
						<div class="list clearfix">
							<div class="shang clearfix">
								<p>账户管理</p>
								<span></span>
							</div>							
							<div class="xia clearfix">
								<ul>
									<li><a href="zhcz.html">账户充值</a></li>
									<li><a href="zhtx.html">账户提现</a></li>
									<li><a href="zffs.html">支付方式</a></li>
								</ul>
							</div>
						</div>						
						<div class="list clearfix">
							<div class="shang clearfix">
								<p>服务合作</p>
								<span></span>
							</div>							
							<div class="xia clearfix">
								<ul>
									<li><a href="friend-link.html">友情链接</a></li>
									<li><a href="ysjrz.html">艺术家入驻</a></li>
								</ul>
							</div>
						</div>
						<div class="list clearfix">
							<div class="shang clearfix">
								<p>关于我们</p>
								<span></span>
							</div>							
							<div class="xia clearfix">
								<ul>
									<li><a href="gsjj.html">公司简介</a></li>
									<li><a href="contact.html">联系我们</a></li>
									<li><a href="jrwm.html">加入我们</a></li>
								</ul>
							</div>
						</div>
						<div class="list clearfix">
							<div class="shang clearfix">
								<p>售后服务</p>
								<span><
							</div>							
							<div class="xia clearfix">
								<ul>
									<li><a href="wlsm.html">物流说明</a></li>
									<li><a href="mzsm.html">免责声明</a></li>
								</ul>
							</div>
						</div>
					</div>
					<div class="middle clearfix fl">
						<ul>
							<li><img src="front/upload/ewm.jpg"/></li>
							<li><img src="front/upload/ewm.jpg"/></li>
							
						</ul>
					</div>
					<div class="right clearfix fr">
						<p class="bt">免费咨询热线：</p>
						<p class="tel">400-000-0000</p>
						<p class="fu-bt">(周一到周五8:00-22:00)</p>
					</div>
				</div>
			</div>
			<div class="banquan clearfix ta-center">
				Copyright © 2020 XXX文化(chunlingwenhua). All Rights Reserved. 
			</div>
		</div>
		<!--footer end-->
	</body>
	<script >
		window.onload = function() {
			console.log(window.location.search);
			const uri = window.location.search;
			if(uri.includes('order')) {
				const doc = document.getElementById('order');
				doc.className = " on fs14 radius3 bc";
			} else if(uri.includes('unpaid')) {
				const doc = document.getElementById('unpaid');
				doc.className = " on fs14 radius3 bc";
			} else if(uri.includes('chaoshi')) {
				const doc = document.getElementById('chaoshi');
				doc.className = " on fs14 radius3 bc";
			}
		}

	</script>
</html>